package com.zhanghe.study.design_pattern.iterator_pattern;

/**
 * 迭代器模式
 * @author zh
 * @date 2022/10/14 14:56
 */
public class Main {
    public static void main(String[] args) {
        String[] names = {"张三","李四","王五"};

        ConcreteCollection<String> collection = new ConcreteCollection<>(names);

        Iterator<String> iterator = collection.iterator();

        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
